#ifndef _NETSER_H_
#define _NETSER_H_

#include <cstring>
#include <iostream>
#include <thread>

class netser {
private:
    int ser_fd;
    int cli_fd;
    int ser_port;
    bool running = false;
    std::thread handle;
    bool run = false;
    std::thread thd;

public:
    netser(int port);
    ~netser();
    int netsend(char* buf, size_t len);
    int netrecv(char* buf, size_t size);
    int start();
    int stop();
    void thread();
};

#endif // _NETSER_H_
